package cn.tedu.school.portal.model;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author tedu.cn
 * @since 2020-07-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("user")
@Accessors(chain = true)
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("student_id")
    private String studentId;

    @NotNull(message = "密码不允许为空")
    @Size(min=4,max=16,message = "密码必须是4-16个字符")
    @TableField("password")
    private String password;

    @TableField("username")
    private String username;

    @TableField("class_id")
    private Integer classId;

    @TableField("phone")
    private String phone;

    @TableField("birthday")
    private LocalDate birthday;

    /**
     * 0=female
1=male
     */
    @TableField("gender")
    private Integer gender;


}
